﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;

namespace WindowsGame2
{
    public static class Assets
    {
        //Textures
        private static Texture2D m_paddleTexture;
        private static Texture2D m_ballTexture;
        private static Texture2D m_pixelTexture;

        //Sound effects
        private static SoundEffect m_beepSound;
        private static SoundEffect m_beepSound1;
        private static SoundEffect m_beepSound2;
        private static SoundEffect m_goalSound;

        //looping sounds
        private static SoundEffect m_moveSound;
        private static SoundEffectInstance m_moveInstance;
        private static SoundEffect m_move2Sound;
        private static SoundEffectInstance m_move2Instance;

        //Music

        //Fonts
        private static SpriteFont m_spriteFont1;


        public static Texture2D Paddle 
        {
            get { return m_paddleTexture; }
        }
        public static Texture2D Ball
        {
            get { return m_ballTexture; }
        }
        public static Texture2D Pixel
        {
            get { return m_pixelTexture; }
        }

        public static SoundEffect BeepSound
        {
            get { return m_beepSound; }
        }
        public static SoundEffect BeepSound1
        {
            get { return m_beepSound1; }
        }
        public static SoundEffect BeepSound2
        {
            get { return m_beepSound2; }
        }
        public static SoundEffect GoalSound
        {
            get { return m_goalSound; }
        }
       
        public static SoundEffect MoveSound
        {
            get { return m_moveSound; }
        }

        public static SoundEffectInstance MoveInstance
        {
            get { return m_moveInstance; }
        }

        public static SoundEffect Move2Sound
        {
            get { return m_move2Sound; }
        }

        public static SoundEffectInstance Move2Instance
        {
            get { return m_move2Instance; }
        }

        public static SpriteFont SpriteFont1
        {
            get { return m_spriteFont1; }
        }   


        public static void Load(ContentManager a_content)
        {
            //Textures
            m_paddleTexture = a_content.Load<Texture2D>(@"textures/paddle");
            m_ballTexture = a_content.Load<Texture2D>(@"textures/ball");
            m_pixelTexture = a_content.Load<Texture2D>(@"textures/pixel");

            //Sounds
            m_beepSound = a_content.Load<SoundEffect>(@"audio/beep");
            m_beepSound1 = a_content.Load<SoundEffect>(@"audio/beep1");
            m_beepSound2 = a_content.Load<SoundEffect>(@"audio/beep2");
            m_goalSound = a_content.Load<SoundEffect>(@"audio/goal2");


            m_moveSound = a_content.Load<SoundEffect>(@"audio/move");            
            m_moveInstance = m_moveSound.CreateInstance();
            m_moveInstance.Volume = 0.2f;
            m_moveInstance.IsLooped = true;

            m_move2Sound = a_content.Load<SoundEffect>(@"audio/move5");
            m_move2Instance = m_move2Sound.CreateInstance();
            m_move2Instance.Volume = 0.05f;
            m_move2Instance.IsLooped = true;
            //Music

            //Fonts
            m_spriteFont1 = a_content.Load<SpriteFont>(@"fonts/SpriteFont1");
        }
    }
}

